package com.thoughtworks;


public class BookCheckout {
        public static int k=0;
        public static String checkOutArray[]=new String[5];
    public static int checkOut(String name) {
        Books book[] = new Books[5];
        book[0] = new Books("Java Puzzlers", "Joshua Bloch", 2005);
        book[1] = new Books("Python:The Complete Reference", "Martin C. Brown", 2001);
        book[2] = new Books("Two States", "Chetan Bhagat", 2014);
        book[3] = new Books("Success Series","Sachchida Nand Jha",2013);
        book[4] = new Books("Frankenstein","Mary Shelley",1998);

        int i, flag = 0;
        for (i = 0; i < book.length; i++) {
            if (name.equals(book[i].bookName)) {
                flag = 1;
                checkOutArray[k++] = book[i].bookName;
            }
        }
           return flag;
    }
}